package cn.tedu.spring.autowired.controller;

import cn.tedu.spring.autowired.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

@Controller
public class UserController {
   @Autowired
   @Qualifier(value = "userServiceImp2")
    private UserService userService;

//    @Autowired
//    public void setUserService(UserService userService) {
//        this.userService = userService;
//    }
//
//    @Autowired
//    public UserController(@Autowired UserService userService) {
//        this.userService = userService;
//    }
//
//    public UserController(UserService userService) {
//        this.userService = userService;
//    }

    public void con(){
        System.out.println("controller正在执行.....");
        userService.serv();
    }
}
